require("../../assets/css/index.less");
require("./mine.less");
require("../../assets/css/basic.less");
require("../../assets/fonts/iconfont.css");
const Swiper = require("../../lib/swiper/swiper-bundle.js");
require("../../lib/swiper/swiper-bundle.css");
let https = require("../../utils/https.js");
let dom = require("../../utils/dom.js");
let local = require('../../utils/local')
dom.bMenu("mine");

dom.ready(function () {
    dom.bMenu("mine");
    dom.getEle('#goBtn').addEventListener('click', function () {
        window.location.href = '/myinfo.html';
    })

    function getInfo() {
        https.get('/api/user/info', {}, function (res) {
            console.log(res)
            if (res.errno == 0) {
                local.set('userData', res.data)
                avatar.src = res.data.imgUrl?'http://47.96.154.185:3701' + res.data.imgUrl:require('../../assets/imgs/headerPic.jpg');
                nickName.innerHTML = res.data.nickName;
                signTxt.innerHTML=res.data.sign
                
            }
        })
    }

    getInfo()
})